package com.ruoyi.web.controller.biz.hugong.openapi;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.service.impl.SysDictDataServiceImpl;
import com.ruoyi.system.service.impl.SysDictTypeServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName DictOpenApi
 * @Description
 * @Author sizegang
 * @Date2024/12/13 00:44
 **/
@RestController
@RequestMapping("/openapi/dict")
public class DictOpenApi {

    @Autowired
    private SysDictDataServiceImpl sysDictDataService;

    @Autowired

    private SysDictTypeServiceImpl sysDictTypeService;

    @ApiOperation("字典查询")
    @GetMapping("/query/{dictType}")
    public AjaxResult queryDict(@PathVariable("dictType") String dictType) {
        List<SysDictData> sysDictDataList = sysDictDataService.selectDictDataByTypeLists(Arrays.asList(dictType.split(",")));
        return AjaxResult.success("查询字典成功", sysDictDataList);
    }

}
